#include "Python.h"

PyObject * hello(PyObject * self, PyObject * args)
{
    printf("Hello, World!\n");
    Py_RETURN_NONE;
}

static PyMethodDef helloMethods[] = {
        { "hello", hello, METH_NOARGS, "Print hello world." },
        { NULL, NULL, 0, NULL }
};

static PyModuleDef helloDef = {
        PyModuleDef_HEAD_INIT,
        "hello",
        "Python interface for hello world C extension",
        -1,
        helloMethods
};

PyMODINIT_FUNC PyInit_hello(void)
{
    return PyModule_Create(&helloDef);
}